/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: JwtTokenService
 * Author:   zhouheng
 * Date:     2019/4/16 8:02
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.dubbo.user.provider.services;

import com.dubbo.user.provider.utils.JwtInfo;
import com.dubbo.user.provider.utils.JwtTokenUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2019/4/16
 * @since 1.0.0
 */
@Service("jwtTokenService")
public class JwtTokenService {
    @Value("${jwt.expire}")
    private int expire;
    
    /**
     * @description: 生成token信息
     * @date: 2019/4/16 23:38
     * @author:zhouheng
     */
    public String generatorToken(JwtInfo jwtInfo){
        return JwtTokenUtil.generatorToken(jwtInfo, expire);
    }

    /**
     * @description: 解析token
     * @date: 2019/4/16 23:39
     * @author:zhouheng
     */
    public JwtInfo getInfoFromToken(String token) {
        JwtTokenUtil.parseTokenInfo(token);
    }
}